package com.gitee.mybase.top.exception;

public enum HttpCode implements BaseEnum<Integer, String>{
    OK(200, "200请求成功"),
    MULTI_STATUS(207, "207频繁操作"),
    BAD_REQUEST(400, "400请求参数出错"),
    UNAUTHORIZED(401, "401没有登录"),
    LOGIN_FAIL(402, "402登录失败"),
    FORBIDDEN(403, "403没有权限"),
    NOT_FOUND(404, "04找不到页面"),
    METHOD_NOT_ALLOWED(405, "405请求方法不能被用于请求相应的资源"),
    NOT_ACCEPTABLE(406, "406内容特性不满足"),
    REQUEST_TIMEOUT(408, "408请求超时"),
    CONFLICT(409, "409发生冲突"),
    GONE(410, "410已被删除"),
    LENGTH_REQUIRED(411, "411没有定义长度"),
    PRECONDITION_FAILED(412, "412条件不满足"),
    ENTITY_TOO_LARGE(413, "413数据太大"),
    UNSUPPORTED_MEDIA_TYPE(415, "415不是服务器中所支持的格式"),
    TOO_MANY_CONNECTIONS(421, "421连接数过多"),
    LOCKED(423, "423已被锁定"),
    UNAVAILABLE_LEGAL(451, "451法律不允许"),
    INTERNAL_SERVER_ERROR(500, "500服务器出错"),
    NOT_IMPLEMENTED(501, "501不支持当前请求所需要的某个功能"),
    SERVICE_UNAVAILABLE(503, "503服务器升级中,暂时不可用"),
    NOT_EXTENDED(510, "510获取资源所需要的策略并没有被满足");

    private  Integer code;
    private  String value;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }
    private HttpCode (Integer code, String value){
        this.code = code;
        this.value = value;
    }
}
